<?php
//error_reporting(E_ERROR);
//define("Page", "Index");
$path = $_SERVER['DOCUMENT_ROOT'];
require_once "$path/public/Cms.php";
$cms = new Cms();
$cms->is_html = isset($is_html) ? $is_html : false;
$head = $cms->header();
$nav_menu = $cms->menus(0);
$fname = basename($_SERVER[REQUEST_URI]);
//$fname = substr($fname, 0, strpos($fname, "?"));
$pid = empty($_GET["type"]) ? empty($_GET["pid"]) ? -1 : $_GET["pid"] : $_GET["id"];
$basepath = substr(dirname(__FILE__), 0, strrpos(dirname(__FILE__), "\\"));
$basepath = substr($basepath, strrpos($basepath, "\\") + 1);
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <meta name='robots' content='max-image-preview:large'/>
    <link rel="canonical" href=""/>
    <meta name="keywords" content="<?php echo $head["keywords"] ?>">
    <meta name="description" content="<?php echo $head["description"] ?>">
    <link rel="stylesheet" href="/<?php echo $basepath ?>/assert/animate.min4.1.css">
    <link rel="stylesheet" href="/<?php echo $basepath ?>/assert/font-awesome.min.css">
    <link rel="stylesheet" href="/<?php echo $basepath ?>/assert/owl.carousel.min.css">
    <link rel="stylesheet" href="/<?php echo $basepath ?>/assert/index.css">
    <link rel="stylesheet" href="/<?php echo $basepath ?>/assert/bootstrap.css">
    <link rel="stylesheet" href="/<?php echo $basepath ?>/assert/style.css">
    <link rel="stylesheet" href="/<?php echo $basepath ?>/assert/slider.css">
    <script type="text/javascript" src="/<?php echo $basepath ?>/assert/js/jquery.js"></script>
    <title><?php echo $head["system_name"] ?></title>
</head>
<body>
<div class="head clf">
    <div class="fl head_lt"><i class="home all_bg"><a href="javascript:void(0);" onClick="SetHome(this,window.location)"
                                                      style="behavior: url(#default#homepage)">设为首页</a></i><i
                class="Stars all_bg"><a href="javascript:;" onClick="addfavor(window.location,document.title)">添加收藏</a></i>
        <p style="margin-left:170px;">您好! 欢迎来到<?php echo $head["systemName"] ?> </p>
    </div>
    <div class="fr head_rt">
        <dl class="clf">
            <dd class="wshwo"><a href="javascript:;" class="weixin all_bg" id="weixin">微信</a>
                <div id="dshow2">
                    <div class="oneshwo"><img src="/<?php echo $basepath . "/" . $head["webchat"] ?>" width="94"
                                              height="94" alt=""/></div>
                    <div class="twoshwo"> 扫码关注官方微信</div>
                </div>
            </dd>
            <dd><span class="tel all_bg">电话：<?php echo $head["tel"] ?></span></dd>
        </dl>
    </div>
</div>
<div class="header clf">
    <div class="logo"><a href="/<?php echo $basepath ?>/"><img height="60"
                                                               src="/<?php echo $basepath . "/" . $head["logo"] ?>"></a>
    </div>
    <div class="nav">
        <dl class="clf">
            <dd class="<?php echo !$pid || $pid == -1 ? "nav_active" : ""; ?>"><a title="首页"
                                                                                  href="/<?php echo $basepath ?>/">首页</a>
            </dd>
            <?php foreach ($nav_menu as $val) { ?>
                <dd class="<?php echo $pid == $val["idMenuinfo"] ? "nav_active" : ""; ?>">
                    <a href='<?php
                    $temp_name=$cms->menuUrlParse($val["menuUrl"]);
                    echo "/" . $basepath . "/" . ($cms->is_html ?  "html/$temp_name/$temp_name"  . $val["idMenuinfo"] . ".html" : $val["menuUrl"] . "?type=" . $val["menuType"] . "&id=" . $val["idMenuinfo"]) ?>'
                       title="<?php echo $val["menuName"] ?>"><?php echo $val["menuName"] ?></a>
                    <?php if (count($val["children"])) { ?>
                        <ul class="nav_two">
                            <?php foreach ($val["children"] as $val2) { ?>
                                <li>
                                    <a href='<?php
                                    $temp_name=$cms->menuUrlParse($val2["menuUrl"]);
                                    echo "/" . $basepath . "/" . ($cms->is_html ? "html/$temp_name/$temp_name" . $val2["idMenuinfo"] . ".html" : $val2["menuUrl"] . "?id=" . $val2["idMenuinfo"] . "&pid=" . $val["idMenuinfo"]) ?>'
                                       title="<?php echo $val2["menuName"] ?>"><?php echo $val2["menuName"] ?></a>
                                </li>
                            <?php } ?>
                        </ul>
                    <?php } ?>
                </dd>
            <?php } ?>
        </dl>
    </div>
</div>
